//
//  MetronomeView.m
//  Metronome
//
//  Created by Pierre DUCHENE on 20/12/09.
//  Copyright 2009 Pierre DUCHENE. All rights reserved.
//

#import "MetronomeView.h"
#import "Materiel.h"


@implementation MetronomeView

- (id)init{
	NSRect frame = NSMakeRect(0, 0, 325, 140);
    self = [super initWithFrame:frame];
    if (self) {
		// On recupere le materiel
        id<ClavierProtocol> clavier = [[Materiel sharedMateriel] clavier];
		id<MoletteProtocol> molette = [[Materiel sharedMateriel] molette];
		id<AfficheurProtocol> afficheur = [[Materiel sharedMateriel] afficheur];
		// On configure les vues
		NSRect aRect = [[(NSViewController*)clavier view] frame];
		aRect.origin.x = 0;
		aRect.origin.y = 0;
		[[(NSViewController*)clavier view] setFrame:aRect];
		
		aRect = [[(NSViewController*)molette view] frame];
		aRect.origin.x = 10;
		aRect.origin.y = 70;
		[[(NSViewController*)molette view] setFrame:aRect];
		
		aRect = [[(NSViewController*)afficheur view] frame];
		aRect.origin.x = 60;
		aRect.origin.y = 60;
		[[(NSViewController*)afficheur view] setFrame:aRect];
		
		[self addSubview:[(NSViewController*)afficheur view]];
		[self addSubview:[(NSViewController*)molette view]];
		[self addSubview:[(NSViewController*)clavier view]];
    }
    return self;
}

@end
